import request from "@/utils/request";
// 菜单基础URL

const Supplier = {
  /**
   *
   * @returns 列表
   */
  getList(queryParams: any) {
    return request<any>({
      url: "supplierInfo/list",
      method: "get",
      params: queryParams,
    });
  },
  //新增 || 编辑
  editSupplier(data: any) {
    return request<any>({
      url: "supplierInfo/edit",
      method: "post",
      data: data,
    });
  },
  //审核列表
  supplierAuditList(queryParams: any) {
    return request<any>({
      url: "supplierApproval/list",
      method: "get",
      params: queryParams,
    });
  },
  //审核
  supplierAudit(data: any) {
    return request<any>({
      url: "supplierApproval/approval",
      method: "post",
      data: data,
    });
  },
  supplierConfigList(queryParams: any) {
    return request<any>({
      url: "supplierConfig/list",
      method: "get",
      params: queryParams,
    });
  },
  //配置删除
  supplierConfigDel(data: any) {
    return request<any>({
      url: "supplierConfig/delete",
      method: "post",
      data: data,
    });
  },
  //供应商配置编辑
  editSupplierConfig(data: any) {
    return request<any>({
      url: "supplierConfig/edit",
      method: "post",
      data: data,
    });
  },
  sendSupplier(data: any) {
    return request<any>({
      url: "order/assignSupplier",
      method: "post",
      data: data,
    });
  },
  //外派司机
  sendDriverOut(data: any) {
    return request<any>({
      url: "order/assignOut",
      method: "post",
      data: data,
    });
  },
  //订单日志
  getLogs(queryParams: any) {
    return request<any>({
      url: "orderTrace/list",
      method: "get",
      params: queryParams,
    });
  },
  //加入抢单池
  orderPoolIn(data: any) {
    return request<any>({
      url: "order/orderPoolIn",
      method: "post",
      data: data,
    });
  },
  //移出抢单池
  orderPoolOut(data: any) {
    return request<any>({
      url: "order/orderPoolOut",
      method: "post",
      data: data,
    });
  },
  //抢单
  catchOrder(data: any) {
    return request<any>({
      url: "order/catchOrder",
      method: "post",
      data: data,
    });
  },
  //回收订单
  orderReclaim(data: any) {
    return request<any>({
      url: "order/orderReclaim",
      method: "post",
      data: data,
    });
  },
  //更改司机状态
  updateDriverStatus(data: any) {
    return request<any>({
      url: "order/driverStatus",
      method: "post",
      data: data,
    });
  },
  //完成订单
  orderComplete(data: any) {
    return request<any>({
      url: "order/orderComplete",
      method: "post",
      data: data,
    });
  },
  //退回渠道
  orderCancel(data: any) {
    return request<any>({
      url: "order/orderCancel",
      method: "post",
      data: data,
    });
  },
  //订单作废
  orderInvalid(data: any) {
    return request<any>({
      url: "order/orderInvalid",
      method: "post",
      data: data,
    });
  },
  //奖励||罚款
  orderReward(data: any) {
    return request<any>({
      url: "wallet/reward",
      method: "post",
      data: data,
    });
  },
  //评价列表
  rateList(queryParams: any) {
    return request<any>({
      url: "orderRate/list",
      method: "get",
      params: queryParams,
    });
  },
  //发票列表
  invoiceList(queryParams: any) {
    return request<any>({
      url: "invoice/list",
      method: "get",
      params: queryParams,
    });
  },
  //开票
  invoiceCreate(data: any) {
    return request<any>({
      url: "invoice/create",
      method: "post",
      data: data,
    });
  },
  //重开
  invoiceRcreate(data: any) {
    return request<any>({
      url: "invoice/recreate",
      method: "post",
      data: data,
    });
  },
  //红冲
  redInvoice(data: any) {
    return request<any>({
      url: "invoice/redInvoice",
      method: "post",
      data: data,
    });
  },
  //重开
  resendInvoice(data: any) {
    return request<any>({
      url: "invoice/resendInvoice",
      method: "post",
      data: data,
    });
  },
  //保险管理
  insuranceList(queryParams: any) {
    return request<any>({
      url: "insurance/list",
      method: "get",
      params: queryParams,
    });
  },
  //询价记录
  statEstimateList(queryParams: any) {
    return request<any>({
      url: "estimateRecord/list",
      method: "get",
      params: queryParams,
    });
  },
  //事件列表
  eventList(queryParams: any) {
    return request<any>({
      url: "event/list",
      method: "get",
      params: queryParams,
    });
  },
};

export default Supplier;
